#pragma once

#include <QWidget>
#include <QWizard>

namespace QInstaller {

class GuiProxy;
class igui {
public:
	igui(QWidget * thisWidget = Q_NULLPTR)
	{
		m_thisWidget = thisWidget;
	}
	virtual void loadControlScript(const QString& scriptPath) = 0;
	virtual void callControlScriptMethod(const QString& methodName) = 0;

	QWidget * widget() { return m_thisWidget; }
	virtual void resetConnect(GuiProxy* proxy) {}

	virtual QWidget *pageById(int id) const { return 0; };
	virtual QWidget *pageByObjectName(const QString &name) const { return 0; }
	virtual QWidget *currentPageWidget() const { return 0; }
	virtual QWidget *pageWidgetByObjectName(const QString &name) const { return 0; }

	virtual QString defaultButtonText(int wizardButton) const { return QLatin1Literal(""); }
	virtual void clickButton(int wizardButton, int delayInMs = 0) {}
	virtual bool isButtonEnabled(int wizardButton) { return false; }
	virtual void useSettingsButton(bool use) {}
	virtual void showSettingsButton(bool show) {}
	virtual void setSettingsButtonEnabled(bool enable) {}
	virtual void setSilent(bool silent) {}
	virtual bool isSilent() const { return true; }
	virtual void setTextItems(QObject *object, const QStringList &items) {}

	virtual void showHeadTitle(bool show, const QString& titleName = QString()) {}
	virtual QWidget * showProtocol(const QString& text = QString(), int x = 0, int y = 0, int width = 100, int height = 20) { return 0; }
	virtual QWidget * showTipLabel(const QString& text = QString(), int x = 0, int y = 0, int width = 100, int height = 20) { return 0; }
	virtual void setDragHeight(int iHeight) {}
	virtual void setStyleSheetPath(const QString &styleSheetPath) {}
	//virtual void setButtonText(int wizardButton, const QString &name) {}
	virtual QWidget * getButton(int wizardButton) { return 0; }
	virtual QWidget * setTimeOut(int timeout) { return 0; }
	virtual void setButtonText2(int wizardButton, const QString &name) {}

	virtual void cancelButtonClicked() {}
	virtual void reject() {}
	virtual void rejectWithoutPrompt() {}
	virtual void showFinishedPage() {}
	virtual void setModified(bool value) {}

	virtual QAbstractButton * wizardButton(QWizard::WizardButton) { return 0; }
	virtual QObject* myPage(int id) { return 0; }

	virtual void currentPageChanged(int newId) {};
	virtual int objCurrentId() { return -1; };

	virtual void nextPage() {};
private:
	QWidget *m_thisWidget;
};

}